package com.example.day12;

/**
 * @author Lenovo
 */
public class Animal {
    abstract class animal {
        public abstract void eat();
    }
    class Cat extends animal {
        @Override
        public void eat() {
            System.out.println("吃鱼");
        }
    }
    class cat extends animal {
        @Override
        public void eat() {
            System.out.println("吃鱼");
        }
    }
    class AnimalOperator {
        public void feed(animal animal) {
            animal.eat();
        }
        public cat getAnimal() {
            return new cat();
        }
        public class AnimalDemo {
            public void main(String[] args) {
                AnimalOperator operator = new AnimalOperator();
                animal a = new cat();
                AnimalOperator ao = null;
                ao.useAnimal(a);
                animal a2 = ao.getAnimal();
                a2.eat();
            }
        }

        private void useAnimal(animal a) {
        }
    }
}
